let login = () => {
	return new Promise((resolve,reject)=>{
		if(isLogin()) return resolve(0)
		if(!isLogin()){
			let that = this;
			uni.showModal({
				title:'温馨提示',
				content:'当前未登录，是否开启授权?',
				success(res) {
					if(res.confirm){
						return resolve(1)
					}
					if(res.cancel){
						uni.showToast({
							title:'您已取消授权登录',
							duration:2000,
							icon:'none'
						})
					}
				}
			})
		}
	})
}

let isLogin = () => {
	return uni.getStorageSync('isLogin')?true:false;
}

export default login